<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@include file="/views/include/taglib.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<c:set var="woOwner" value="${requestScope.woOwner }"></c:set>
<title>${woOwner.nickname }的主页</title>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/stringutil.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/base.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/feed.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/comment.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/pagination.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/shortMessage.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/notification.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/follow.js"></script>
<link href="/skyline/css/comment.css" rel="stylesheet" type="text/css" />
<link href="/skyline/css/base.css" rel="stylesheet" type="text/css" />
<style type="text/css">
#bodyDiv{
	position:relative;
	top:42px;
	width:960px;
	min-height:500px;
	height:auto !important;
	margin:0 auto;
}
#woOwnerDiv{
	float:right; 
	width:240px; 
	height:500px; 
	background:#ffff;
	left:10px;
}
#content{
	float:left;
	width:720px; 
	min-height:500px;
	background:#ffff;
}
hr{
boder:1px dashed #cccccc;
}
</style>
</head>
<body onload="Feed.getFeedsInitial(${woOwner.id});">
<%@ include file="/views/include/statusbar.jsp"%>
<div id="bodyDiv">
	<div id="woOwnerDiv">
		<c:choose>
			<c:when test="${empty woOwner.portrait }">
				<img src="${portraitPath }/head.jpg"/>
			</c:when>
			<c:otherwise>
				<img src="${portraitPath }/${woOwner.portrait}"/>
			</c:otherwise>
		</c:choose>
		<br/>
		<c:set var="redirectUrl" value="${pageContext.request.contextPath}/wo/${woOwner.id}.html" />
		<c:if test="${requestScope.viewerId == 0 }">
			<a href="${pageContext.request.contextPath}/login.html?requestFrom=${redirectUrl }">关注TA</a>
		</c:if>
		<c:if test="${requestScope.viewerId != 0 and not requestScope.isSelf}">
			<div id="follow" <c:if test="${requestScope.isIdol}">style="display:none"</c:if> >
				<a href="#" onclick="Follow.follow('${woOwner.id }','${woOwner.nickname }','${woOwner.portrait }','USER',this,followedOk,'${redirectUrl }');">关注TA</a>
			</div>
			<div id="unfollow" <c:if test="${not requestScope.isIdol}">style="display:none"</c:if> >
				<a href="#" onclick="Follow.unfollow('${woOwner.id }','USER',this,unfollowedOk,'${redirectUrl }');">取消关注</a>
			</div>
			<script type="text/javascript">
				function followedOk(input) {
					$('#unfollow').show();
					$('#follow').hide();
				}
				function unfollowedOk(input) {
					$('#follow').show();
					$('#unfollow').hide();
				}
			</script>
		</c:if>
		<table>
		<tr><td><a href="${pageContext.request.contextPath}/wo/myWo.html">新鲜事</a></td></tr>
		<tr><td><a href="${pageContext.request.contextPath}/article/list/user/${woOwner.id}.html">日志</a></td></tr>
		<tr><td><a href="${pageContext.request.contextPath}/article/list/user/${woOwner.id}.html">相册</a></td></tr>
		<tr><td><a href="${pageContext.request.contextPath}/share/list/user/${woOwner.id}.html">分享</a></td></tr>
		</table>
	</div>
	<div id="content">
		<div id="feedsDiv">
		</div>
		<input type="button" value="更多新鲜事" onclick="javascript:Feed.getFeeds();" />
	</div>
</div>
</body>
</html>